<?php

namespace App\Entity;

use ApiPlatform\Core\Annotation\ApiResource;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ApiResource()
 * @ORM\Entity(repositoryClass="App\Repository\MoneyPayOrderRepository")
 */
class MoneyPayOrder
{
    /**
     * @ORM\Id()
     * @ORM\GeneratedValue()
     * @ORM\Column(type="integer")
     */
    private $id;

    /**
     * @ORM\ManyToOne(targetEntity="App\Entity\User")
     */
    private $user;

    /**
     * @ORM\ManyToOne(targetEntity="App\Entity\MoneyType")
     */
    private $moneyType;

    /**
     * @ORM\ManyToOne(targetEntity="App\Entity\MoneyLogType")
     */
    private $logType;

    /**
     * @ORM\Column(type="float")
     */
    private $money;

    /**
     * 回调唯一码
     * @ORM\Column(type="string", length=255)
     */
    private $sn;

    /**
     * @ORM\Column(type="datetime")
     */
    private $createAt;

    /**
     * @ORM\Column(type="datetime", nullable=true)
     */
    private $payAt;

    /**
     * 创建订单时的额外参数
     * @ORM\Column(type="json", nullable=true)
     */
    private $param = [];

    /**
     * 回调数据
     * @ORM\Column(type="json", nullable=true)
     */
    private $data = [];

    public function getId(): ?int
    {
        return $this->id;
    }

    public function getUser(): ?User
    {
        return $this->user;
    }

    public function setUser(?User $user): self
    {
        $this->user = $user;

        return $this;
    }

    public function getMoneyType(): ?MoneyType
    {
        return $this->moneyType;
    }

    public function setMoneyType(?MoneyType $moneyType): self
    {
        $this->moneyType = $moneyType;

        return $this;
    }

    public function getLogType(): ?MoneyLogType
    {
        return $this->logType;
    }

    public function setLogType(?MoneyLogType $logType): self
    {
        $this->logType = $logType;

        return $this;
    }

    public function getMoney(): ?float
    {
        return $this->money;
    }

    public function setMoney(float $money): self
    {
        $this->money = $money;

        return $this;
    }

    public function getSn(): ?string
    {
        return $this->sn;
    }

    public function setSn(string $sn): self
    {
        $this->sn = $sn;

        return $this;
    }

    public function getCreateAt(): ?\DateTimeInterface
    {
        return $this->createAt;
    }

    public function setCreateAt(\DateTimeInterface $createAt): self
    {
        $this->createAt = $createAt;

        return $this;
    }

    public function getPayAt(): ?\DateTimeInterface
    {
        return $this->payAt;
    }

    public function setPayAt(?\DateTimeInterface $payAt): self
    {
        $this->payAt = $payAt;

        return $this;
    }

    public function getParam(): ?array
    {
        return $this->param;
    }

    public function setParam(?array $param): self
    {
        $this->param = $param;

        return $this;
    }

    public function getData(): ?array
    {
        return $this->data;
    }

    public function setData(?array $data): self
    {
        $this->data = $data;

        return $this;
    }
}
